<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>方法的定义和调用</title>
</head>
<body>

<script>
    var f ={
        name: "冯-feng",
        birth: 1921,
        age: function () {
            let now = new Date().getFullYear();
            return now-this.birth;
        }
    }
    alert(f)
    alert(f.age())
</script>
</body>
</html>